<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <title>
        {% block title %}{% endblock %}
    </title>
</head>
<body>
<!-- 导航栏 -->
<nav class="navbar navbar-inverse" role="navigation">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="{% url 'user:index' %}">首页</a>
        </div>
        <div>
            <ul class="nav navbar-nav">
                <li><a href="#">专栏1</a></li>
                <li><a href="#">专栏2</a></li>
                <li><a href="#">专栏3</a></li>
                <li><a href="#">专栏4</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                {% if not login_user %}
                    <!-- 如果用户未登录 -->
                    <li>
                        <a href="{% url 'user:login' %}">登录</a>
                    </li>
                {% else %}
                    <!-- 如果用户已登录，显示"你好：用户名" -->
                    <li>
                        <a href="#">
                            你好：{{ login_user.username }}
                        </a>
                    </li>
                {% endif %}
            </ul>
        </div>
    </div>
</nav>

{% block article %}{% endblock %}

</body>
</html>